package com.data;

import cn.hutool.core.lang.ObjectId;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil;
import cn.hutool.log.Log;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.internal.util.privilegedactions.GetClassLoader;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.regex.Pattern;

import static java.util.regex.Pattern.compile;

/**
 * @author helele
 * @date 2021/7/28
 */
@Slf4j
@SpringBootApplication
public class Application {
    public static void main(String[] args) {


//        String a= "asdf";
//        System.out.println("test:"+a.substring(a.length()-1));
//        System.out.println("test:"+a.charAt(0));

//        Pattern pattern = compile("[0-9]*");
//        String str = "123a23dsafa12453";
//        StringBuilder num = new StringBuilder();
//        StringBuilder val = new StringBuilder();
//
//        boolean isNum = true;
//        for (int x = str.length() - 1; x >= 0; x--) {
//            String s = String.valueOf(str.charAt(x));
//            if (isNum && pattern.matcher(s).matches()) {
//                num.append(s);
//            } else {
//                isNum = false;
//                val.append(s);
//            }
//        }
//        System.out.println(num.reverse());
//        System.out.println(val.reverse());

//        String str = "12341adsad13";
//        StringBuilder num = new StringBuilder();
//        StringBuilder val = new StringBuilder();
//        boolean isNumber = true;
//        for (int x = 0; x < str.length(); x++) {
//            String s = String.valueOf(str.charAt(x));
//            if (isNumber && pattern.matcher(s).matches()) {
//                num.append(s);
//            } else {
//                isNumber = false;
//                val.append(s);
//            }
//        }
//        //因为是相反的，所以要reverse
//        System.out.println(num);
//        System.out.println(val.toString());

//        System.out.println( IdUtil.objectId());
//        System.out.println(IdUtil.objectId().length());


        SpringApplication.run(Application.class, args);
    }
}
